home *** CD-ROM | disk | FTP | other *** search
/ Risc World 7 / Risc World 7.iso / Software / Issue6 / SDL.ZIP / !ballfield / h / ballfield
Text File  |  2007-03-14  |  1KB  |  62 lines

  1. /*
  2.  * "Ballfield"
  3.  *
  4.  *   (C) David Olofson <david@olofson.net>, 2002
  5.  *
  6.  * This software is released under the terms of the GPL.
  7.  *
  8.  * Contact author for permission if you want to use this
  9.  * software, or work derived from it, under other terms.
  10.  */
  11.  
  12. #ifndef    _BALLFIELD_H_
  13. #define    _BALLFIELD_H_
  14.  
  15. #include <SDL/SDL.h>
  16.  
  17. /*----------------------------------------------------------
  18.     Definitions...
  19. ----------------------------------------------------------*/
  20.  
  21. #define    BALLS    200
  22.  
  23. #define    COLORS    2
  24.  
  25. typedef struct
  26. {
  27.     Sint32    x, y, z;    /* Position */
  28.     Uint32    c;        /* Color */
  29. } point_t;
  30.  
  31.  
  32. /*
  33.  * Ballfield
  34.  */
  35. typedef struct
  36. {
  37.     point_t        points[BALLS];
  38.     SDL_Rect    *frames;
  39.     SDL_Surface    *gfx[COLORS];
  40.     int        use_alpha;
  41. } ballfield_t;
  42.  
  43.  
  44. /*
  45.  * Size of the screen in pixels
  46.  */
  47. #define    SCREEN_W    320
  48. #define    SCREEN_H    240
  49.  
  50. /*
  51.  * Size of the biggest ball image in pixels
  52.  *
  53.  * Balls are scaled down and *packed*, one pixel
  54.  * smaller for each frame down to 1x1. The actual
  55.  * image width is (obviously...) the same as the
  56.  * width of the first frame.
  57.  */
  58. #define    BALL_W    32
  59. #define    BALL_H    32
  60.  
  61. #endif    /* _BALLFIELD_H_ */
  62.